bool Add(T item) |
Add an item to this collection if possible.
Returns: | True. | Parameters: | item: | The item to add. |
|
void AddAll<U>(IEnumerable<U> items) |
Add the elements from another collection with a more specialized item type
to this collection.
Type parameters: | | U | The type of items to add | Constraints: | | | U : T |
Parameters: | items: | The items to add |
|
IDirectedCollectionValue<T> Backwards() |
Create a collection containing the same items as this collection, but
whose enumerator will enumerate the items backwards. The new collection
will become invalid if the original is modified. Method typicaly used as in
foreach (T x in coll.Backwards()) {...} Returns: | The backwards collection. |
|
bool Check() |
Check the sanity of this list
|
T Choose() |
Choose some item of this collection.
|
void Clear() |
Remove all items from this collection.
|
object Clone() |
Make a shallow copy of this LinkedList.
|
bool Contains(T item) |
Check if this collection contains (an item equivalent to according to the
itemequalityComparer) a particular value.
Returns: | True if the items is in this collection. | Parameters: | item: | The value to check for. |
|
bool ContainsAll<U>(IEnumerable<U> items) |
Check if this collection contains all the values in another collection
with respect to multiplicities.
Type parameters: | | U | | Constraints: | | | U : T |
Returns: | True if all values in items is in this collection. | Parameters: | items: | The |
|
int ContainsCount(T item) |
Count the number of items of the collection equal to a particular value.
Returns 0 if and only if the value is not in the collection.
Returns: | The number of copies found. | Parameters: | item: | The value to count. |
|
T Dequeue() |
Dequeue an item from the front of the queue.
|
void Dispose() |
Invalidate this list. If a view, just invalidate the view.
If not a view, invalidate the list and all views on it.
|
void Enqueue(T item) |
Enqueue an item at the back of the queue.
|
IEnumerable<T> Filter(Fun<T,bool> filter) |
Create an enumerable, enumerating the items of this collection that satisfies
a certain condition.
Returns: | The filtered enumerable | Parameters: | filter: | The T->bool filter delegate defining the condition |
|
bool Find(ref T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, return in the ref argument (a
binary copy of) the actual value found.
Returns: | True if the items is in this collection. | Parameters: | item: | The value to look for. |
|
F IList<T> FindAll(Fun<T,bool> filter) |
Create a new list consisting of the items of this list satisfying a
certain predicate.
Returns: | The new list. | Parameters: | filter: | The filter delegate defining the predicate. |
|
bool FindOrAdd(ref T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, return in the ref argument (a
binary copy of) the actual value found. Else, add the item to the collection.
Returns: | True if the item was found (hence not added). | Parameters: | item: | The value to look for. |
|
System.Collections.Generic.IEnumerator<T> GetEnumerator() |
Create an enumerator for the collection
|
int GetSequencedHashCode() | |
int GetUnsequencedHashCode() |
Performs a check for view validity before calling base.GetUnsequencedHashCode()
|
int IndexOf(T item) |
Searches for an item in the list going forwrds from the start.
Returns: | Index of item from start. | Parameters: | item: | Item to search for. |
|
void Insert(int i, T item) |
Insert an item at a specific index location in this list.
/ThrowsSystem.IndexOutOfRangeException if i is negative or
> the size of the collection.Parameters: | i: | The index at which to insert. | item: | The item to insert. |
|
F void Insert(IList<T> pointer, T item) |
Insert an item at the end of a compatible view, used as a pointer.
The pointer must be a view on the same list as
this and the endpoitn of pointer must be
a valid insertion point of this Throws | | IncompatibleViewException | If pointer
is not a view on the same list as this | System.IndexOutOfRangeException | ?????? if the endpoint of
pointer is not inside this | DuplicateNotAllowedException | if the list has
AllowsDuplicates==false and the item is
already in the list. |
|
void InsertAll<U>(int i, IEnumerable<U> items) |
Insert into this list all items from an enumerable collection starting
at a particular index.
/ThrowsSystem.IndexOutOfRangeException if i is negative or
> the size of the collection.
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | i: | Index to start inserting at | items: | Items to insert |
|
void InsertFirst(T item) |
Insert an item at the front of this list.
Parameters: | item: | The item to insert. |
|
void InsertLast(T item) |
Insert an item at the back of this list.
Parameters: | item: | The item to insert. |
|
F bool IsSorted() |
Check if this list is sorted according to the default sorting order
for the item type T, as defined by the Comparer<T> class
Returns: | True if the list is sorted, else false. |
|
bool IsSorted(System.Collections.Generic.IComparer<T> c) |
Check if this list is sorted according to a specific sorting order.
Returns: | True if the list is sorted, else false. | Parameters: | c: | The comparer defining the sorting order. |
|
ICollectionValue<KeyValuePair<T,int>> ItemMultiplicities() | |
int LastIndexOf(T item) |
Searches for an item in the list going backwords from the end.
Returns: | Index of of item from the end. | Parameters: | item: | Item to search for. |
|
IList<T> LastViewOf(T item) |
Create a list view on this list containing the last occurrence of a particular item.
/ThrowsSystem.ArgumentException if the item is not in this list.
Returns: | The new list view. | Parameters: | item: | The item to find. |
|
F IList<V> Map<V>(Fun<T,V> mapper) |
Create a new list consisting of the results of mapping all items of this
list.
Returns: | The new list. | Parameters: | mapper: | The delegate definging the map. |
|
F IList<V> Map<V>(Fun<T,V> mapper, System.Collections.Generic.IEqualityComparer<V> equalityComparer) |
Create a new list consisting of the results of mapping all items of this
list. The new list will use a specified equalityComparer for the item type.
Type parameters: | | V | The type of items of the new list |
Returns: | The new list. | Parameters: | mapper: | The delegate defining the map. | equalityComparer: | The equalityComparer to use for the new list |
|
P void modifycheck(int stamp) |
Check that the list has not been updated since a particular time.
Parameters: | stamp: | The stamp indicating the time. |
|
F T Pop() |
Pop the item at the top of the stack from the stack.
|
F void Push(T item) |
Push an item to the top of the stack.
|
T Remove() |
Remove one item from the list: from the front if FIFO
is true, else from the back.
/ThrowsC5.NoSuchItemException if this list is empty.
Returns: | The removed item. |
|
bool Remove(T item) |
Remove a particular item from this collection. Since the collection has bag
semantics only one copy equivalent to the supplied item is removed.
Returns: | True if the item was found (and removed). | Parameters: | item: | The value to remove. |
|
bool Remove(T item, out T removeditem) |
Remove a particular item from this collection if found (only one copy).
If an item was removed, report a binary copy of the actual item removed in
the argument.
Returns: | True if the item was found (and removed). | Parameters: | item: | The value to remove on input. | removeditem: | The value removed. |
|
void RemoveAll<U>(IEnumerable<U> items) |
Remove all items in another collection from this one, taking multiplicities into account.
Always removes from the front of the list.
The asymptotic running time complexity of this method is O(n+m+v*log(v)) ,
where n is the size of this list, m is the size of the
items collection and v is the number of views.
The method will temporarily allocate memory of size O(m+v) .
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | items: | The items to remove. |
|
void RemoveAllCopies(T item) |
Remove all items equivalent to a given value.
The asymptotic complexity of this method is O(n+v*log(v)) ,
where n is the size of the collection and v
is the number of views.
Parameters: | item: | The value to remove. |
|
T RemoveAt(int i) |
Remove the item at a specific position of the list.
/ThrowsSystem.IndexOutOfRangeException if i is negative or
>= the size of the collection.
Returns: | The removed item. | Parameters: | i: | The index of the item to remove. |
|
T RemoveFirst() |
Remove one item from the front of the list.
/ThrowsC5.NoSuchItemException if this list is empty.
Returns: | The removed item. |
|
void RemoveInterval(int start, int count) |
Remove all items in an index interval.
/ThrowsSystem.IndexOutOfRangeException???.
Parameters: | start: | The index of the first item to remove. | count: | The number of items to remove. |
|
T RemoveLast() |
Remove one item from the back of the list.
/ThrowsC5.NoSuchItemException if this list is empty.
Returns: | The removed item. |
|
void RetainAll<U>(IEnumerable<U> items) |
Remove all items not in some other collection from this one, taking multiplicities into account.
The asymptotic running time complexity of this method is O(n+m+v*log(v)) ,
where n is the size of this collection, m is the size of the
items collection and v is the number of views.
The method will temporarily allocate memory of size O(m+v) . The stated complexitiy
holds under the assumption that the itemequalityComparer of this list is well-behaved.
Type parameters: | | U | | Constraints: | | | U : T |
Parameters: | items: | The items to retain. |
|
void Reverse() |
Reverse the list so the items are in the opposite sequence order.
|
bool SequencedEquals(ISequenced<T> that) | |
void Shuffle() |
Randomly shuffle the items of this list.
Will invalidate overlapping views??? |
void Shuffle(System.Random rnd) |
Shuffle the items of this list according to a specific random source.
Will invalidate overlapping views??? Parameters: | rnd: | The random source. |
|
F IList<T> Slide(int offset) |
Slide this list view along the underlying list.
Throws | | NotAViewException | if this list is not a view. | System.ArgumentOutOfRangeException | if the operation
would bring either end of the view outside the underlying list. |
Parameters: | offset: | The signed amount to slide: positive to slide
towards the end. |
|
F IList<T> Slide(int offset, int size) |
Slide this list view along the underlying list, perhaps changing its size.
Throws | | NotAViewException | if this list is not a view. | System.ArgumentOutOfRangeException | if the operation
would bring either end of the view outside the underlying list. |
Parameters: | offset: | The signed amount to slide: positive to slide
towards the end. | size: | The new size of the view. |
|
void Sort() |
Sort the items of the list according to the default sorting order
for the item type T, as defined by the Comparer[T] class.
(Comparer<T>).
The sorting is stable.
Throws | | System.InvalidOperationException | if T is not comparable |
|
void Sort(System.Collections.Generic.IComparer<T> c) |
Sort the items of the list according to a specific sorting order.
The sorting is stable.
Parameters: | c: | The comparer defining the sorting order. |
|
IList<T> Span(IList<T> otherView) | Returns null if otherView is strictly to the left of this view Returns: | | Parameters: | otherView: | |
|
bool TrySlide(int offset) | Returns: | | Parameters: | offset: | |
|
bool TrySlide(int offset, int size) | Returns: | | Parameters: | offset: | | size: | |
|
ICollectionValue<T> UniqueItems() | |
bool UnsequencedEquals(ICollection<T> that) | |
bool Update(T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, update the item in the collection
to with a binary copy of the supplied value. Will update a single item.
Returns: | True if the item was found and hence updated. | Parameters: | item: | Value to update. |
|
bool Update(T item, out T olditem) | Returns: | | Parameters: | item: | | olditem: | |
|
P void updatecheck() |
Check if it is valid to perform updates and increment stamp of
underlying if this is a view.
This method should be called in every public modifying
methods before any modifications are performed.
Throws | | System.InvalidOperationException | if check fails. |
|
bool UpdateOrAdd(T item) |
Check if this collection contains an item equivalent according to the
itemequalityComparer to a particular value. If so, update the item in the collection
to with a binary copy of the supplied value; else add the value to the collection.
Returns: | True if the item was found and updated (hence not added). | Parameters: | item: | Value to add or update. |
|
bool UpdateOrAdd(T item, out T olditem) | Returns: | | Parameters: | item: | | olditem: | |
|
IList<T> View(int start, int count) |
Create a list view on this list.
Throws | | System.ArgumentOutOfRangeException | if the start or count is negative | System.ArgumentException | if the range does not fit within list. |
Returns: | The new list view. | Parameters: | start: | The index in this list of the start of the view. | count: | The size of the view. |
|
IList<T> ViewOf(T item) |
Create a list view on this list containing the (first) occurrence of a particular item.
Throws | | System.ArgumentException | if the item is not in this list. |
Returns: | The new list view. | Parameters: | item: | The item to find. |
|